package model

import "github.com/jinzhu/gorm"

type GormSingleTask struct {
	gorm.Model
	Event    string `json:"event" gorm:"type:varchar(15);not null"`
	EventId  string `json:"eventId" gorm:"type:varchar(8);not null"`
	Keyword  string `json:"keyword" gorm:"type:varchar(20);not null"`
	Platform int    `json:"platform" gorm:"type:int;not null"`
	TaskId   string `json:"taskId" gorm:"type:varchar(6);not null"`
	Quality  string `json:"quality" gorm:"type:varchar(5);not null"`
	Publish  string `json:"publish" gorm:"type:varchar(5);not null"`
	View     string `json:"view" gorm:"type:varchar(5);not null"`
	Duration string `json:"duration" gorm:"type:varchar(5);not null"`
	JobId    string `json:"jobId" gorm:"type:char(15);unique;not null"`
	State    int    `json:"state" gorm:"type:int"`
}

type DownloadRecord struct {
	gorm.Model
	Url string `gorm:"type:varchar(50);unique"`
}

type VideoInfo struct {
	gorm.Model
	Vid          string `json:"vId" gorm:"type:varchar(20);not null"`
	Url          string `json:"vUrl" gorm:"type:varchar(100);not null"`
	Platform     int    `json:"platform" gorm:"type:int;not null"`
	EventId      string `json:"eventId" gorm:"type:varchar(8);not null"`
	Event        string `json:"eventName" gorm:"type:varchar(15);not null"`
	TaskId       string `json:"taskId" gorm:"type:varchar(6);not null"`
	Title        string `json:"vTitle" gorm:"type:varchar(100);not null"`
	Summary      string `json:"vSummary" gorm:"type:varchar(200)"`
	PublishTime  int64  `json:"vPublishTime" gorm:"type:bigint(13);not null"`
	CrawlTime    int64  `json:"vCrawlTime" gorm:"type:bigint(13);not null"`
	ViewCount    int    `json:"vViewCount" gorm:"type:int"`
	LikeCount    int    `json:"vLikeCount" gorm:"type:int"`
	CommentCount int    `json:"vCommentCount" gorm:"type:int"`
	HashTag      string `json:"vHashTag" gorm:"type:varchar(100)"`
	AuthorId     string `json:"authorId" gorm:"type:varchar(30);not null"`
}

type AuthorInfo struct {
	gorm.Model
	AuthorId  string `json:"authorId" gorm:"type:varchar(30);not null"`
	Platform  int    `json:"platform" gorm:"type:int;not null"`
	NickName  string `json:"nickName" gorm:"type:varchar(30);not ull"`
	Introduce string `json:"introduce" gorm:"type:varchar(100)"`
	Following int    `json:"following" gorm:"type:int"`               // 关注数
	Followed  int    `json:"followed" gorm:"type:int"`                // 粉丝数
	Works     int    `json:"works" gorm:"type:int"`                   // 作品数
	Likes     int    `json:"likes" gorm:"type:int"`                   // 点赞数
	Views     int    `json:"views" gorm:"type:int;column:total_view"` // 点赞数
}

type TaskRecord struct {
	gorm.Model
	TaskId  string `json:"task_id" gorm:"type:varchar(6);not null"`
	Email   string `json:"email" gorm:"type:varchar(20);not null"`
	Total   int    `json:"total" gorm:"type:int"`
	Release int    `json:"release" gorm:"type:int"`
}
